package tankgame03;

/**
 * @author DCSGO
 * @version 1.0
 * 坦克爆炸效果
 */

@SuppressWarnings({"all"})
public class Bomb extends Thread {
    int x, y;
    int life = 9;
    boolean visible = true;

    public Bomb(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public void run() {
        while (visible) {
            lifeDown();
            try {
                Thread.sleep(30);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public void lifeDown() {
        if (life > 0) {
            life--;

        } else {
            visible = false;
        }
    }
}
